#ifndef PHP_MONITORPRO_H
#define PHP_MONITORPRO_H

#include "src/common.h"

MONITORPRO_BEGIN_EXTERN_C()

#include "php.h"
#include "php_ini.h"
#include "main/SAPI.h"
#include "zend_API.h"
#include "zend_interfaces.h"
#include "zend_types.h"

#include "ext/standard/info.h"
#include "ext/standard/url.h"

extern zend_module_entry monitorpro_module_entry;
#define phpext_monitorpro_ptr &monitorpro_module_entry

#define PHP_MONITORPRO_VERSION "0.1.0" /* Replace with version number for your extension */

#ifdef PHP_WIN32
#define PHP_MONITORPRO_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
#define PHP_MONITORPRO_API __attribute__((visibility("default")))
#else
#define PHP_MONITORPRO_API
#endif

#ifdef ZTS
#include "TSRM.h"
#endif

ZEND_BEGIN_MODULE_GLOBALS(monitorpro)
  zend_bool debug;
  zend_bool enable;
  // zend_bool skyenable;
  // int skyversion;
  // char *skyagentip;
  // char *skyagentport;
  // int skyqueuesize;
  zend_bool pushenable;
  // int pushinterval;
  // int pushtimeout;
  // int pushconnecttimeout;
  // char *pushhost;
  char *pushbucket;
  char *pushcollect;
  int pushcollectsize;
  int pushbuf;
  int pushflushinterval;
  char *log;

  void *segment;
  zval curl_header;
  zval context;
ZEND_END_MODULE_GLOBALS(monitorpro)

extern ZEND_DECLARE_MODULE_GLOBALS(monitorpro);

PHP_FUNCTION(helloworld);

PHP_MINIT_FUNCTION(monitorpro);
PHP_MSHUTDOWN_FUNCTION(monitorpro);
PHP_RINIT_FUNCTION(monitorpro);
PHP_RSHUTDOWN_FUNCTION(monitorpro);
PHP_MINFO_FUNCTION(monitorpro);

#ifdef ZTS
#define MONITORPRO_G(v) TSRMG(monitorpro_globals_id, zend_monitorpro_globals *, v)
#else
#define MONITORPRO_G(v) (monitorpro_globals.v)
#endif

#if defined(ZTS) && defined(COMPILE_DL_MONITORPRO)
ZEND_TSRMLS_CACHE_EXTERN()
#endif

MONITORPRO_END_EXTERN_C()

#endif